package cn.codergege.demo.controller

import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RestController
@RequestMapping("/http")
class GetController {
    val params = HashMap<String, String>()

    /**
     *  测试 GetMapping 注解
     */
    @GetMapping("/{city_id}/{user_id}")
    fun findUser(
        @PathVariable("city_id") cityId: String,
        @PathVariable("user_id") userId: String
    ): Map<String, String> {
        params.clear()
        params["city"] = cityId
        params["user_id"] = userId
        params["name"] = "赵波"

        return params
    }
}